package com.xxxx;

import com.alibaba.druid.pool.DruidDataSource;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.xxxx.config.BeanConfig;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created By ShaoXikai on 2022/7/20
 */
public class TestAppData {

    @Test
    public void testDruid() {
        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(BeanConfig.class);
        DruidDataSource dataSource = ac.getBean(DruidDataSource.class);
        System.out.println(dataSource);
    }

    @Test
    public void testC3p0() {
        ApplicationContext ac = new AnnotationConfigApplicationContext(BeanConfig.class);
        ComboPooledDataSource c3p0DataSource = ac.getBean(ComboPooledDataSource.class);
        System.out.println(c3p0DataSource);
    }
}
